import { defineStore } from "pinia";

export const userStore = defineStore("store", {
  state: () => {
    return {
      token: "",
    };
  },
  actions: {
    setToken(token) {
      if (token) {
        this.token = token;
      }
    },
  },
  persist: {
    storage: localStorage,
    paths: ["token"],
  },
});
export default userStore;
